package com.tx.spingcloud.configbusclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope //使用该注解 在配置文件更新后 会把新的内容更新到对应字段
public class HelloController {

    @Value("${mercury.hello}")
    private String message;

    @RequestMapping("/hello")
    public String hello(){
        return message;
    }
}
